#!/bin/sh

# Remove Python binding link
prlsdkapi_link="/Library/Frameworks/ParallelsVirtualization.framework/Versions/Current/Libraries/Python/prlsdkapi"
[ -e "$prlsdkapi_link" ] && rm -f "$prlsdkapi_link"

python_bins="
python2.5
python2.6
python
"

# remove Python binding links from site-packages
for python_bin in $python_bins; do
    if type $python_bin > /dev/null 2>&1; then
        # Path to Python's 'site-package' directory
        PythonSitePackageDir=$($python_bin -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")

        # Remove link to Python module
        if [ -L "${PythonSitePackageDir}/prlsdkapi" ]; then
            rm -f "${PythonSitePackageDir}/prlsdkapi"
        fi
    fi
done
